﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentNHibernate.Cfg;
using FluentNHibernate.Cfg.Db;
using NHibernate;
using NHibernate.Cfg;
using NHibernate.Tool.hbm2ddl;
using WhiteFox.DAlessio.Agenda.Domain.Model;
using FluentNHibernate.Mapping;

namespace WhiteFox.DAlessio.Agenda.Domain.Model.Mapping
{
    public class ContatoMap : ClassMap<Contato>
    {
        public ContatoMap()
        {
            //Schema("Agenda");
            //Table("Contato");
            Id(x => x.Id).GeneratedBy.Native();
            Map(x => x.Nome).Not.Nullable();
            HasMany<Telefone>(x => x.Telefones)
                    .Inverse()
                    .AsBag();
        }
    }
}
